<?php
/**
 * The following variables are available in this template:
 * - $this: the CrudCode object
 */
?>
<?php
echo "<?php\n";
$label=$this->pluralize($this->class2name($this->modelClass));
echo "\$this->breadcrumbs=array(
	'$label'=>array('admin'),
	'管理',
);\n";
?>


Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('<?php echo $this->class2id($this->modelClass); ?>-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<div id="page-header">
	<h1>管理<?php echo "<?php echo \$this->moduleName; ?>" ?></h1>
    <div id="page-options">
	<?php echo "<?php \$this->renderPartial('_menu',array(
    'model'=>\$model,
    )); ?>\n"; ?>
    </div>
</div>


<?php echo "<?php \$this->renderPartial('_search',array(
'model'=>\$model,
)); ?>\n"; ?>


<section class="grid_9" id="dashtabs">
<div class="box-header">
  <?php echo "<?php echo \$this->moduleName.\"列表\"; ?>" ?>
</div>
<?php echo "<?php"; ?> $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'<?php echo $this->class2id($this->modelClass); ?>-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
<?php
$count=0;
foreach($this->tableSchema->columns as $column)
{
	//if(++$count==7)
	//	echo "\t\t/*\n";
	echo "\t\t'".$column->name."',\n";
}
//if($count>=7)
//	echo "\t\t*/\n";
?>
		array(
			'class'=>'CButtonColumn',
            'viewButtonImageUrl'=> Yii::app()->request->baseUrl.'/css/img/icons/16/page.png',            
            'updateButtonImageUrl'=> Yii::app()->request->baseUrl.'/css/img/icons/16/page_edit.png',
            'deleteButtonImageUrl'=> Yii::app()->request->baseUrl.'/css/img/icons/16/page_delete.png',
		),
	),
    'template'=>'{items}{summary}{pager}',
    'htmlOptions'=>array(
    	'class'=>'cgridview'
    ),
    'cssFile' => Yii::app()->request->baseUrl.'/css/widgets/cgridview.css',
)); ?>
</section>